import request from "@/utils/request";

const path = '/photo'
// 获取所有的分类信息
export const getPhotoCategory = () => {
  return request({
    url: path + '/category'
  })
}

// 新增相册分类
export const saveCategory = (data) => {
  return request({
    url: path + '/category/save',
    method: 'post',
    data
  })
}

// 根据分类id删除分类
export const delCategory = (id) => {
  return request({
    url: path + `/category/del/${id}`,
    method: 'delete'
  })
}

// 根据分类id修改相册分类
export const updateCategory = (id, data) => {
  return request({
    url: path + `/category/update/${id}`,
    method: 'put',
    data
  })
}

// 根据id回显相册数据
export const getCategory = (id) => {
  return request({
    url: path + `/category/${id}`
  })
}

// 根据分类id获取分类下的照片
export const getPhotoByCategory = (state, id) => {
  return request({
    url: path + `/photo/${id}/${state}`
  })
}

// 删除图片
export const delPhoto = (data) => {
  return request({
    url: path + '/photo',
    method: 'delete',
    data
  })
}

// 隐藏图片
export const concealPhoto = (state, data) => {
  return request({
    url: path + `/conceal/${state}`,
    method: 'put',
    data
  })
}

// 获取视频
export const getVideo = (state) => {
  return request({
    url: path + `/video/${state}`
  })
}